﻿<a class="menu-toggler" id="menu-toggler" href="#">
    <span class="menu-text"></span>
</a>

<div class="sidebar" id="sidebar">
    <script type="text/javascript">
        try { ace.settings.check('sidebar', 'fixed') } catch (e) { }
    </script>

    @*<div class="sidebar-shortcuts" id="sidebar-shortcuts">
            <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
                <button class="btn btn-success">
                    <i class="icon-signal"></i>
                </button>

                <button class="btn btn-info">
                    <i class="icon-pencil"></i>
                </button>

                <button class="btn btn-warning">
                    <i class="icon-group"></i>
                </button>

                <button class="btn btn-danger">
                    <i class="icon-cogs"></i>
                </button>
            </div>

            <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
                <span class="btn btn-success"></span>

                <span class="btn btn-info"></span>

                <span class="btn btn-warning"></span>

                <span class="btn btn-danger"></span>
            </div>
        </div>*@
    <!-- #sidebar-shortcuts -->

    <ul class="nav nav-list">
        <li class="active">
            <a href="/Admin/Home/Index">
                <i class="icon-dashboard"></i>
                <span class="menu-text"> 控制台 </span>
            </a>
        </li>
        @{
            //先查找显示总管理员的菜单列表
            var menuList = Sundry.App_Start.Common.PubliFunction.GetAdminMenu().ToList();
            var baseMenu = menuList.Where(m => m.ParentMenuId == 0);
            foreach (var item in baseMenu)
            {
                if (item.ParentMenuId == 0)
                {
                    var childrenMenu = menuList.Where(m => m.ParentMenuId == item.AdminMenuId);
                    <li>
                        <a href="@(item.MenuActionUrl == "" ? "javascript:void(0)" : "/Admin" + item.MenuActionUrl)" @if (childrenMenu.Count() > 0) { <text> class="dropdown-toggle" </text>  }>
                            <i class="@item.Icon"></i>
                            <span class="menu-text"> @item.MenuName </span>
                            @if (childrenMenu.Count() > 0)
                            {
                                <b class="arrow icon-angle-down"></b>
                            }
                        </a>

                        @if (childrenMenu.Count() > 0)
                        {
                            <ul class="submenu">
                                @foreach (var secondMenu in childrenMenu)
                                {
                                    <li>
                                        
                                        <a href="/Admin/@secondMenu.MenuActionUrl.Substring(1)">
                                            <i class="@secondMenu.Icon"></i>
                                            @secondMenu.MenuName
                                        </a>
                                    </li>
                                }
                            </ul>
                        }

                    </li>
                }
            }
        }
    </ul><!-- /.nav-list -->

    <div class="sidebar-collapse" id="sidebar-collapse">
        <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
    </div>

    <script type="text/javascript">
        try { ace.settings.check('sidebar', 'collapsed') } catch (e) { }
    </script>
</div>